using Game.Core;
using Game.Main.Model;
using Game.Main.View;
using UnityEngine;

namespace Game.Component
{
	public class TelephoneBoothPhoneItem : BaseItem
	{
		private bool isCalling;

		private float waitTimer;

		public override void Init(ItemArchiveData data)
		{
			base.Init(data);
		}

		protected override void LateUpdate()
		{
			if (!isCalling)
			{
				return;
			}
			waitTimer += Time.deltaTime;
			if (waitTimer >= 2f)
			{
				isCalling = false;
				waitTimer = 0f;
				BaseItem itemByScriptType = Singleton<Scene>.Instance.GetItemByScriptType(153);
				if (itemByScriptType != null)
				{
					((AmbulanceItem)itemByScriptType).MoveToPoint1();
				}
			}
		}

		public override void TouchDown(TouchEventData touchEventData)
		{
			base.TouchDown(touchEventData);
			if (!isCalling)
			{
				isCalling = true;
				waitTimer = 0f;
				base.PlayClickSound();
			}
		}

		public override void PlayClickSound()
		{
		}
	}
}
